Computer storage infrastructure often includes cache and memory. Cache generally includes at least one layer and often several layers of cache. The highest layer of cache is referred to as the L1 cache and is generally the smallest and fastest. The next layer would be the L2 cache, and so on. The lowest level of cache is sometimes referred to as the last-level cache, which is typically the largest and slowest. Cache generally includes a data cache and an instruction cache. When executing an application, application code is pulled into the instruction cache. The application code brings along data that is stored in the data cache. The last-level cache is sometimes shared by data and instructions. As execution of the application proceeds, instructions are pulled into the cache, executed, and flushed from the cache to make room for more instructions. If the instructions needed for execution are already in the cache, no flush is necessary, which is referred to as a cache hit. Otherwise, when the next instruction is not already in cache, it is referred to as a cache miss. A cache that is flushed less frequently generally performs more efficiently. For a given program's performance, the instruction cache is the most important component of the storage infrastructure.
Much research is devoted to improving utilization of the instruction cache. Code layout is an effective way to optimize using a compiler. Code layout refers to a variety of code-changing mechanisms, including inline functions, function cloning, function reordering, basic-block reordering, stack frame changing, and others. Recent literature reflects the realization that code layout can significantly impact performance. More specifically, the impact of changing the size of environment variables can be quite dramatic. For more information regarding this impact, refer to T. Mytkowicz, A. Diwan, M. Hauswirth, and P. F. Sweeney, Producing Wrong Data Without Doing Anything Obviously Wrong! ASPLOS '09, pp. 265-276, ACM, 2009, which is hereby incorporated herein by reference. Additionally, changing the link order of object files can also impact performance. For more information regarding this impact, refer to Charlie Curtsinger and Emery D. Berger, STABILIZER: statistically sound performance evaluation, SIGPLAN Not. 48, 4 (March 2013), 219-228, which is hereby incorporated herein by reference.